1. Field of the Invention
The present invention relates to a numerical controller and more particularly to a numerical controller that controls timing of reading and buffering of a machining program and timing of operation execution based on the machining program if the transfer rate of the machining program is low.
2. Description of the Related Art
A numerical controller loads a machining program held in an internal memory and performs automatic operation. Recent spread of CAD/CAM systems allows creation of a machining program which achieves a complicated free-form surface machining shape through interpolation with minute line segments, which makes machining programs increasingly huge. In order for a numerical controller to execute a huge machining program, an internal memory needs to be increased in capacity. The increase in capacity of the internal memory leads to an increase in cost and a reduction in speed and has limitations.
A storage medium as an auxiliary storage, such as a commercially available floppy (registered trademark) disk drive or a CompactFlash (registered trademark) card, can be connected to a numerical controller, and a machining program can be stored in the storage medium (see, e.g., Japanese Patent Application Laid-Open No. 2005-135153). There is commonly known direct numerical control (DNC) operation that performs operation while reading out a machining program saved in an auxiliary storage as described above as a way to supplement an internal memory with limited capacity (see, e.g., Japanese Patent Application Laid-Open No. 2004-078476).
There is also known DNC operation in a configuration in which a computer as a host and a numerical controller are communicatively connected. In the DNC operation, machining program data transferred from the host via communication tool is accumulated in a file device or a memory of the numerical controller, and the numerical controller controls machining using the accumulated machining program data (see, e.g., Japanese Patent Application Laid-Open No. 2003-195930).
A readout time period in readout of a machining program in DNC operation as described earlier is longer than that in readout from an internal memory of a numerical controller, regardless of readout from an auxiliary storage or transfer from a host. This generally increases a machining time period. In order to prevent an increase in machining time period, operation may be performed with block-by-block processing of machining program data accumulated in an internal memory of a numerical controller while a result of readout from an auxiliary storage or a host is accumulated in the memory. As such a function, Japanese Patent Application Laid-Open No. 07-239707 introduces a remote operation function of sequentially taking out machining program data in an operation buffer in a memory block by block to perform operation while accumulating machining program data transferred from a host to a numerical controller in the operation buffer.
FIG. 13 is a remote operation process block diagram of a numerical controller 100 having a remote operation function in Japanese Patent Application Laid-Open No. 07-239707. Machining program data PD transferred from a host 200 is transferred to an operation buffer 150 via a communication control unit 140 of the numerical controller 100. The machining program data PD transferred to the operation buffer 150 is taken out into a block analysis unit 110 block by block, and taken-out blocks are sequentially analyzed. Each analysis result SR is passed to a block execution unit 120, and machining is executed.
FIG. 14 is a block diagram of a remote operation function of reading out machining program data from an auxiliary storage 300 instead of transferring machining program data from the host 200. FIG. 14 is the same as FIG. 13 except that machining program data PD to the operation buffer 150 is transferred from the auxiliary storage 300.
A numerical controller having a remote operation function as described earlier suffers from the problem below. If a process of transferring blocks of machining program data transferred from a host or an auxiliary storage to an operation buffer is slower than a process of taking out machining program data by a block analysis unit and a block execution unit, the operation buffer may become empty to stop machining, and a cutter mark may be made in a workpiece or vibration may occur.
To cope with the problem, Japanese Patent Application Laid-Open No. 07-239707 discloses a method that involves avoiding cutter mark making or vibration due to stoppage of machining by reducing a cutting feed rate if the amount of data left of machining program data in an operation buffer falls below a predetermined block number.
However, there is generally no guarantee of an upper limit for a time period for readout from an auxiliary storage. Since transfer from a host to a numerical controller generally depends on host or network congestion, an upper limit for a time period for transfer cannot be generally guaranteed, like a time period for readout from an auxiliary storage. For this reason, use of the method disclosed in Japanese Patent Application Laid-Open No. 07-239707 suffers from the problem below. It is unclear how much a cutting feed rate is to be actually reduced to avoid emptiness in an operation buffer.
Japanese Patent Application Laid-Open No. 07-239707 also discloses a solution, i.e., the idea of preventing cutter mark making or vibration by making a tool during cutting retreat in an axial direction in which the tool is attached even in a worst case where an operation buffer becomes empty. The operation of making a tool during cutting feed to retreat and then returning the tool causes a problem in the quality of a machining surface and is not applicable to finishing or the like. Thus, problems cannot be said to be solved. Additionally, in Japanese Patent Application Laid-Open No. 07-239707, whether to enable the tool retreat function as described earlier can be set. Japanese Patent Application Laid-Open No. 07-239707, however, also suffers from the problem below. If a machining program in an operation buffer actually becomes empty in a portion for which the tool retreat function is disabled, cutter mark making or vibration cannot be prevented.
In addition, in Japanese Patent Application Laid-Open No. 07-239707, the percentage of reduction in cutting feed rate (a cutting feed override), whether to reduce the rate, whether to enable the tool retreat function, and the like are specified in a statement of a machining program. If a machining program is long, to edit the details of the entire area of the machining program so as to change such settings on an as-needed basis takes effort and is not practical.